package com.gdcn.zb.sys.dao.impl;

import java.util.List;

import com.gdcn.zb.base.BaseDao;
import com.gdcn.zb.base.exception.DaoException;
import com.gdcn.zb.sys.dao.ITypeEconomicDao;
import com.gdcn.zb.sys.valueobject.TypeEconomic;

public class TypeEconomicDaoHibernate extends BaseDao implements ITypeEconomicDao {

	@Override
	protected Class getModelClass() {
		return TypeEconomic.class;
	}

	public TypeEconomic findTypeEconomicById(int id) throws DaoException {
		return (TypeEconomic)super.doFindObjectById(id);
	}

	public List listTypeEconomicOfAll() throws DaoException {
		return doListAllObject();
	}
	
	public List listTypes(String parentcode) throws DaoException {
		return super.doFind("from "+this.getClass().getName()+" type where type.parent.code="+parentcode);
	}
}

